#pragma once
#include <string>
#include <boost/asio.hpp>
#include "../enum_t/enum_t.hpp"

// http://www.programmableweb.com/link/bing-translations-api
// http://www.codeforexcelandoutlook.com/blog/2010/04/translation-services-using-bing-api/
// http://www.bing.com/developers/appids.aspx?MsgID=1&SuffixID=4A422BC1

namespace umtl
{
	class translator
	{
	public:
		enum_t( e_lang, (ar)(bg)(zhCHS)(zhCHT)(cs)(da)(nl)(en)(ht)(fi)(fr)(de)(el)(he)(hu)(it)(ja)(ko)(lt)(no)(pl)(pt)(ro)(ru)(sk)(sl)(es)(sv)(th)(tr) )

		static std::string translate( std::string & text, e_lang to, e_lang from = e_lang::enum_end );

		static e_lang detect( std::string & text );

	private:
		static std::string parseResult( boost::asio::ip::tcp::iostream & http_stream );

		static std::string _appId;
	};
}